package corba.service;

import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;

import org.omg.CORBA.ORB;

public class TelephoneServiceImpl extends TelephoneServicePOA {

	private ORB orb;
	private HashMap<String, String> map;

	public TelephoneServiceImpl() {
		super();
		map = new HashMap<String, String>();
		map.put("61", "Australia");
		map.put("63", "Philipin");
	}


	public void setORB(ORB orb_val) {
		orb = orb_val;
	}
	
	
	@Override
	public String receiveTelephone(String number) {
		for(Map.Entry<String, String> entry : map.entrySet()) {
			if (entry.getKey().equals(number)) {
				return entry.getValue();
			}
		}
		
		return "no number";
	}

}
